package com.example.xgakj.newterminal.ui.activities;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.FrameLayout;

import com.example.xgakj.mylibrary.mvp.utils.FragmentHelper;
import com.example.xgakj.newterminal.R;
import com.example.xgakj.newterminal.ui.framents.DeviceListFragment;
import com.qmuiteam.qmui.widget.QMUITopBar;

import butterknife.BindView;
import butterknife.ButterKnife;

public class DeviceManageActivity extends AppCompatActivity {


    @BindView(R.id.topbar)
    QMUITopBar topbar;
    @BindView(R.id.content)
    FrameLayout content;
    private FragmentHelper fragmentHelper;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_device_manage);
        ButterKnife.bind(this);
        fragmentHelper = new FragmentHelper(getSupportFragmentManager(), R.id.content);
        initTopBar();
        initViews();

    }
    public FragmentHelper getHelper(){
        return fragmentHelper;
    }


    private void initViews() {
        DeviceListFragment deviceListFragment=new DeviceListFragment();
        fragmentHelper.addFragment(deviceListFragment);
    }


    private void initTopBar() {
        topbar.setTitle("设备管理");
        topbar.addLeftBackImageButton().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }


}
